﻿@using Kairos.Views

@model Kairos.Models.Graphe

@{
    ViewBag.Title = "Graphe n°" + Model.ID;
}

<div class="content-wrapper">
    <div class="float-left">
        <h2>@Html.DisplayFor(model => model.Titre)</h2>
    </div>
    <div class="display-label float-right">
        <table>
            <tr>
                <td align="right">
                    <span class="display-label">
                        Id :
                    </span>
                    <span class="display-field">
                        @Model.ID
                    </span>

                    <br />

                    &nbsp;
                </td>
                <td align="right">
                    <span class="display-label">
                        Lien :
                    </span>
                    <span class="display-field">
                        @Url.Action("Details", "Graphe", new { id = Model.ID })
                    </span>

                    <br />

                    <span class="display-label">
                        @Html.DisplayNameFor(model => model.Image) :
                    </span>
                    <span class="display-field">
                        @Html.ActionLink(@Url.Action("Data", "Image", new { id = Model.ImageID }), "Data", "Image", new { id = Model.ImageID }, new { target = "_blank" })
                    </span>
                </td>
            </tr>
        </table>
    </div>
</div>

<fieldset class="clear-both">
    <legend>Graphe</legend>

    <p />

    <div class="rich-text">
        @Html.ImageMap(Model.Image, Model.Mappages)
    </div>

    <table class="props">
        <tr>
            <td>
                <span class="display-label">
                    @Html.DisplayNameFor(model => model.DateCreation)
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.DateCreation)
                </span>
                <span class="display-label">
                    par
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.UserCreation)
                </span>

                <br />

                <span class="display-label">
                    @Html.DisplayNameFor(model => model.DateModification)
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.DateModification)
                </span>
                <span class="display-label">
                    par
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.UserModification)
                </span>
            </td>
            <td align="right">
                <span class="display-label">
                    @Html.DisplayNameFor(model => model.Revision)
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.Revision)
                </span>

                <br />

                <span class="display-label">
                    @Html.DisplayNameFor(model => model.DateExpiration)
                </span>
                <span class="display-field">
                    @Html.DisplayFor(model => model.DateExpiration)
                </span>
            </td>
        </tr>
    </table>

    <table class="props">
        <tr>
            <td>
                <div>
                    &nbsp;
                    @*@Html.ButtonLink("Rechercher", "Graphe", "Search", null, new { @class = "ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" })*@
                </div>
            </td>
            <td align="right">
                <div>
                    @using (Html.BeginForm("Delete", "Graphe", new { id = Model.ID }, FormMethod.Post, new
                    {
                        onsubmit = "return confirm('Le graphe sera supprimé définitivement.')"
                    }))
                    {
                        @Html.AntiForgeryToken()
                        if (ViewBag.ShouldDisplayUI(Kairos.Roles.Administrator | Kairos.Roles.Worker))
                        {
                            <input type="submit" value="Supprimer" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                            @Html.ButtonLink("Modifier", "Edit", new { id = Model.ID }, new { @class = "ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" })
                            @Html.ButtonLink("Modifier les liens", "Index", "Mappage", new { id = 0, grapheID = Model.ID }, new { @class = "ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" })
                        }
                    }
                </div>
            </td>
        </tr>
    </table>

</fieldset>
